import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/layout/home' },
  { path: '/login', component: () => import('@/views/Login.vue') },
  {
    path: '/layout',
    component: () => import('@/views/Layout/index.vue'),
    children: [
      { path: 'home', component: () => import('@/views/Layout/Home.vue') },
      { path: 'faqs', component: () => import('@/views/Layout/Faqs.vue') },
      { path: 'video', component: () => import('@/views/Layout/Video.vue') },
      { path: 'my', component: () => import('@/views/Layout/My.vue') },
      { path: 'search', component: () => import('@/views/Layout/search.vue') }
    ]
  },
  { path: '/article/:articleId', component: () => import('@/views/Layout/article.vue'), props: true }
]

const router = new VueRouter({
  routes
})

export default router
